import type { R, TableDataInfo } from '@/api/model/resultModel';
import type { PayActivityOrderForm, PayActivityOrderQuery, PayActivityOrderVo } from '@/api/pay/model/activityOrderModel';
import { request } from '@/utils/request';

// 查询订单列表
export function listActivityOrder(query?: PayActivityOrderQuery) {
  return request.get<TableDataInfo<PayActivityOrderVo>>({
    url: '/pay/activityOrder/list',
    params: query,
  });
}

// 查询订单详细
export function getActivityOrder(orderId: number) {
  return request.get<R<PayActivityOrderVo>>({
    url: `/pay/activityOrder/${orderId}`,
  });
}

// 新增订单
export function addActivityOrder(data: PayActivityOrderForm) {
  return request.post<R<void>>({
    url: '/pay/activityOrder',
    data,
  });
}

// 修改订单
export function updateActivityOrder(data: PayActivityOrderForm) {
  return request.put<R<void>>({
    url: '/pay/activityOrder',
    data,
  });
}

// 删除订单
export function delActivityOrder(orderIds: number | Array<number>) {
  return request.delete<R<void>>({
    url: `/pay/activityOrder/${orderIds}`,
  });
}
